<?php
/**
 * Created by PhpStorm.
 * User: 式神 (luck48.com)
 * Email: 289650682@qq.com
 * Name: ${NAME}Administrator
 * Date: 2017-04-07
 * Time: 16:39
 */
function template($template='default'){
    $files="views/template/".$template;
    $hostdir=resource_path($files);
    $filesnames = scandir($hostdir);
    $data=[];
    foreach ($filesnames as $name) {
        if($name!='.' && $name!='..'){
            $file=explode('.', $name);
            if($file[1]=='blade' && $file[2]=='php' && $file[0]!='layouts'){
                array_push($data,$file[0]);
            }
        }
    }
    return $data;
}